import React from 'react';
import {render} from 'react-dom';
// 引入PC与Mobile响应式
import MediaQuery from 'react-responsive';
import PCIndex from "./adapter/pc/pc_index";
import MobileIndex from "./adapter/mobile/mobile_index";
// 路由
import {Router,Route,hashHistory,IndexRoute} from "react-router";
import Top from "./adapter/pc/pages/top";
import Guoji from "./adapter/pc/pages/guoji";
import Guonei from "./adapter/pc/pages/guonei";
import Yule from "./adapter/pc/pages/yule";
import Shehui from "./adapter/pc/pages/shehui";
import Junshi from "./adapter/pc/pages/junshi";
// 个人中心
import Center from "./adapter/pc/components/center";

import NewsDetails from "./adapter/pc/pages/secondpages/newsdetails";
import ShehuiSecond from "./adapter/pc/pages/secondpages/shehuisecond";

class Hello extends React.Component {
  render() {
    return (
      <div>
        <MediaQuery query="(min-device-width: 1224px)">
          {/* PC端 */}
          <Router history={hashHistory}>
            <Route path="/" component={PCIndex}>
              <IndexRoute component={Top}></IndexRoute>
              <Route path="/guoji" component={Guoji}></Route>
              <Route path="/details" component={NewsDetails}></Route>
              <Route path="/guonei" component={Guonei}></Route>
              <Route path="/yule" component={Yule}></Route>
              <Route path="/shehui" component={Shehui}>
                <Route path="/shehui/second" component={ShehuiSecond}></Route>
              </Route>
              <Route path="/junshi" component={Junshi}></Route>
            </Route>
            <Route path="/center" component={Center}></Route>
          </Router>
        </MediaQuery>
        
        <MediaQuery query="(max-device-width: 1224px)">
          {/* Mobile端 */}
          <MobileIndex />
        </MediaQuery>
      </div>
    )
  }
}

render(
  <Hello/>,
  document.getElementById('root')
)